<?php

/*
 * Class teia\webdev\php\core\signup_form
* Registration form
*
* @author Bernardo Quibiana
* @date created: 20111017
*
* @date modified: 20111018
* @modified: Bernardo Quibiana
*/

// namespace declaration: Core Templates
namespace teia\webdev\php\core;

if (!isset($action)) $action = '';
if (!isset($method)) $method = 'POST';

if (!isset($header_txt)) $header_txt = 'Sign Up';
if (!isset($display_name_txt)) $display_name_txt = 'Display name';
if (!isset($email_txt)) $email_txt = 'E-mail';
if (!isset($passwd_txt_1)) $passwd_txt_1 = 'Password';
if (!isset($passwd_txt_2)) $passwd_txt_2 = 'Repeat Password';

if (!isset($gender_txt)) $gender_txt = 'Gender';
if (!isset($m_gender_txt)) $m_gender_txt = 'Male';
if (!isset($f_gender_txt)) $f_gender_txt = 'Female';

if (!isset($birthday_txt)) $birthday_txt = 'Birthday';

if (!isset($terms_txt)) $terms_txt = 'Terms';
if (!isset($privacy_txt)) $privacy_txt = 'Privacy';

if (!isset($terms_url)) $terms_url = 'terms.php';
if (!isset($privacy_url)) $privacy_url = 'privacy.php';

if (!isset($agreement_txt)) $agreement_txt = AGREEMENT_TXT;

if (!isset($submit_txt)) $submit_txt = 'Submint';

?>

<!-- Display user sign up form -->
<div id="usr_signup_form">	
	<form action="<?php echo $action; ?>" method="<?php echo $method; ?>">
		<fieldset class="form_fieldset">
			<legend><?php echo $header_txt; ?></legend>
			<input type="hidden" name="form_name" value="signup_form" />
			<p class="signup_txt">
				<label class="input_label" for="signup_dname_input"><?php echo $display_name_txt; ?>:</label>
				<input class="input_field" id="signup_dname_input" type="text" name="display_name" required="required" />
			</p>
			<p class="signup_txt">
				<label class="input_label" for="signup_email_input"><?php echo $email_txt; ?>:</label>
				<input class="input_field" type="email" name="email" required="required" />
			</p>
			<p class="signup_txt">
				<label class="input_label" for="signup_password_input"><?php echo $passwd_txt_1; ?>:</label>
				<input class="input_field" id="signup_password_input" type="password" name="password_1" required="required" />
			</p>
			<p class="signup_txt">
				<label class="input_label" for="signup_password_input2"><?php echo $passwd_txt_2; ?>:</label>
				<input class="input_field" id="signup_password_input2" type="password" name="password_2" required="required" />
			</p>
			<p class="signup_txt">
				<label class="input_label" for="signup_bday_input"><?php echo $birthday_txt; ?>:</label>
				<input class="date_field" id="signup_bday_input" type="date" name="birthday" required="required" />
			</p>
			<p class="signup_radio">
				<label class="input_label" for="gender_options"><?php echo $gender_txt; ?>:</label>
				<span class="input_field" id="gender_options">
					<input id="m_gender" type="radio" name="gender" value="M" required="required" />
					<label for="m_gender"><?php echo $m_gender_txt; ?></label>
					<input id="f_gender" type="radio" name="gender" value="F" required="required" />
					<label for="f_gender"><?php echo $f_gender_txt; ?></label>
				</span> 
			</p>
			<p class="terms_privacy">
				<span>
					<a href="<?php echo $terms_url; ?>"><?php echo $terms_txt; ?></a>
				</span>
				<label> &amp; </label>
				<span>
					<a href="<?php echo $privacy_url; ?>"><?php echo $privacy_txt; ?></a>
				</span>
			</p>
			<p class="agreement" style="display: block; align: center;">
				<span style="float: left; width: 10%; vertical-align: middle;"> 
					<input id="accept_terms" type="checkbox" name="accept_terms" value="accept" required="required" />
				</span>
				<span style="float: right; width: 90%; vertical-align: middle; text-align: justify;">
					<label for="accept_terms"><?php echo $agreement_txt; ?></label>
				</span>
			</p>
			<p class="signup_submit">
				<input type="submit" name="submit" value="<?php echo $submit_txt; ?>" /> 
			</p>
		</fieldset>
	</form>
</div>
